<!DOCTYPE html>
<html>
<body>

<?php
function myTest()
{
    static $x=0;
    echo $x;
    $x++;
    echo PHP_EOL;    // 换行符
}

myTest();
myTest();
myTest();
?>

</body>
</html>